//
//  OptionsTypeModel.m
//  SAP
//
//  Created by 中矿科技有限公司 on 17/9/12.
//  Copyright © 2017年 中矿科技有限公司. All rights reserved.
//

#import "OptionsTypeModel.h"

@implementation OptionsTypeModel

+(NSArray *)getGetOptionsTypefromData:(NSData *)data{
    NSDictionary *dict =[NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil];
    NSMutableArray *result =[NSMutableArray array];
    
    
    if (![dict[@"result"] isKindOfClass:[NSArray class]]) {
        return result;
    }
    for (NSDictionary * typeDict in dict[@"result"] ) {
        OptionsTypeModel *model =[OptionsTypeModel mj_objectWithKeyValues:typeDict];
        [result addObject:model];
    }
    OptionsTypeModel *model =[[OptionsTypeModel alloc]init];
    model.key =@-1;
    model.value =@"全部";
    [result addObject:model];
    return result;
}

@end
